package com.lglbc;

import com.alibaba.csp.sentinel.annotation.SentinelResource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

/**
 * @Author 乐哥聊编程
 * @Doc 关注公众号"乐哥聊编程"获取文档和源码
 * @Date 2023/6/10
 * @Description
 */
@RestController
public class HelloController {
    @SentinelResource(value = "hello")
    @GetMapping("/hello")
    public String hello() throws InterruptedException {
        int millis = new Random().nextInt(150, 300);
        Thread.sleep(millis);
        return "hello 乐哥聊编程 晚上好"+millis;
    }
}
